package com.chinasoft.enumdef;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 中软zhang
 * @create 2025-08-15 9:15
 */
public enum Elem {
    Glass(0), House(1), Gold(4), Man(5), Box(3), BoxGold(9);

    public static  final Map<Integer, Elem> map = new HashMap<>();

    static {
        for(Elem e: Elem.values()) {
            map.put(e.getVal(), e);
        }
    }

    public static Elem getElemFromVal(int val) {
        return map.get(val);
    }

    int val;
    Elem(int val) {
        this.val = val;
    }

    public int getVal() {
        return this.val;
    }
}
